import java.util.Scanner;

public class Main1 {


    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            String line = scanner.nextLine();
            System.out.print(handler(line));
        }
    }

    public static int handler(String words) {
        String[] wordArr = words.split(" ");
        String lastWord = wordArr[wordArr.length - 1];
        return lastWord.length();
    }
}
